package com.huawei.game;

import com.huawei.object.Computer;
import com.huawei.object.Person;
import com.huawei.service.RockPaperScissorlmpl;
import lombok.extern.slf4j.Slf4j;
import java.util.Random;
import java.util.Scanner;
@Slf4j
public class Game {
    public static void main(String[] args){
        //人--机对战
        Person james = new Person();
        james.setName("James");
        Scanner input = new Scanner(System.in);
        james.setBodyLanguage(input.nextInt());

        Person tomes = new Person();
        tomes.setName("James");
        Scanner input2 = new Scanner(System.in);
        tomes.setBodyLanguage(input2.nextInt());

        Computer computer1 = new Computer();
        computer1.setIp("192.168.1.1");
        Random random = new Random();
        computer1.setNumber(random.nextInt(3));

        RockPaperScissorlmpl standard = new RockPaperScissorlmpl();

        //对应人的输赢平，0-输，1-赢，2-平
        switch (standard.gameStandardOfPerson(james.getbodyLanguage(),computer1.getNumber())){
            case 0:
                log.info("你输给了电脑");
                break;
            case 1:
                log.info("你打败了电脑");
                break;
            case 2:
                log.info("你和电脑打成平手");
                break;
        }

    }
}
